package net.lab1024.sa.ai.stream.module.business.ai.integration;

import org.springframework.stereotype.Component;

@Component
public class QwenErrorCodeHandler implements LlmErrorCodeHandler {
    @Override
    public String getModelType() {
        return "qwen";
    }

    @Override
    public String getFriendlyMessage(int statusCode, String errorBody) {
        switch (statusCode) {
            case 400: return "Qwen：请求格式错误。";
            case 401: return "Qwen：API key 错误或认证失败。";
            case 402: return "Qwen：账户余额不足。";
            case 422: return "Qwen：参数错误。";
            case 429: return "Qwen：请求过于频繁。";
            case 500: return "Qwen：服务器内部故障。";
            case 503: return "Qwen：服务器繁忙。";
            default:
                return "Qwen API 调用失败，错误码：" + statusCode + "，请联系管理员。";
        }
    }
} 